/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package serializacao;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import javax.swing.JOptionPane;

/**
 *
 * @author Bush
 */
public class SerializacaoXML {
    File arquivo = new File("pessoas.xml");
    public SerializacaoXML() {
    }

    public void gravar(String nome) {
        FileWriter w;
        try {
            w = new FileWriter(arquivo, true);
            BufferedWriter bf = new BufferedWriter(w);
            bf.write("<nome>"+nome+"</nome>");
            bf.newLine();
            bf.close();
        } catch (IOException ex) {
            JOptionPane.showMessageDialog(null, ex.getMessage());
        }
    }
}
